﻿<div class="tree-view">
    <div class="tree-scroll">
        <ul class="tree">
            <li class="tree-item first" ng-include="'document.html'"></li>
        </ul>
    </div>
</div>


<script type="text/ng-template" id="document.html">
    <div class="tree-block" ng-click="selectOperation(operation)" ng-class="{'__selected': currentOperation.id == operation.id}">
        <div class="inner">
            <div class="tree-el __title">
                <i class="tree-ico fa fa-info-circle"></i>
                {{operation.operationType +' #'+operation.number}}
            </div>
            <div class="tree-el __date">
                <i class="tree-ico fa fa-calendar"></i>
                {{operation.createdDate | date}}
            </div>
            <div class="tree-el __price">
                <i class="tree-ico fa fa-money"></i>
                {{operation.sum +' '+operation.currency}}
            </div>
            <div class="tree-el __canceled" ng-if="operation.status">
                {{operation.status}}
            </div>
        </div>
    </div>
    <ul class="tree-node" ng-class="{'__empty': operation.childrenOperations.length == 1}" ng-if="operation.childrenOperations.length > 0">
        <li class="tree-item"  ng-repeat="operation in operation.childrenOperations" ng-include="'document.html'"></li>
    </ul>
</script>